all:
	chmod 755 apps/* ar2524drv/* docs/* -R
	make -C ar2524drv ZD1211REV_B=0
	make -C ar2524drv ZD1211REV_B=1
	cd apps/openssl-0.9.8g/ && ./config no-shared no-dso && make && cd ../../
	make -C apps/hostapd-0.4.8 STATIC_BUILD=1
	make -C apps/wpa_supplicant_0.4.8_zydas_v2 STATIC_BUILD=1  
	make -C apps/wps_enrollee
	make -C apps/wsc/src/linux/ STATIC_BUILD=1
	gcc ar2524drv/apdbg.c -o ar2524drv/apdbg
    
clean:
	make -C ar2524drv ZD1211REV_B=0 clean
	make -C ar2524drv ZD1211REV_B=1 clean
	make -C apps/hostapd-0.4.8 clean
	make -C apps/wpa_supplicant_0.4.8_zydas_v2 clean  
	make -C apps/wps_enrollee clean
	make -C apps/wsc/src/linux/ clean
	-cd apps/openssl-0.9.8g/ && make clean 

install:
	-rm -rf target
	mkdir target
	-cp ar2524drv/zd1211b.o target
	-cp ar2524drv/zd1211b.ko target
	cp ar2524drv/apdbg target
	cp apps/hostapd-0.4.8/hostapd target
	cp apps/wpa_supplicant_0.4.8_zydas_v2/wpa_supplicant target
	cp apps/wps_enrollee/wps_enrollee target
	cp apps/wsc/src/linux/wsccmd target
	cp apps/wsc/src/linux/wsc_cfg target
	cp -R apps/etc target
	cp apps/wps_enrollee/wps_enrollee.conf target/etc/ath
	cp apps/wpa_supplicant_0.4.8_zydas_v2/wpa_supplicant_psk.conf target/etc/ath
	cp apps/wpa_supplicant_0.4.8_zydas_v2/wpa_supplicant_tls.conf target/etc/ath
	cp apps/openssl-0.9.8g/apps/openssl target
	-strip -d target/*

